/**
 * @description 展示简单toast后自动返回上一页
 * @param title {string} toast标题
 * @param duration {number} toast显示时间 单位毫秒
 */
export default function autobackToast(title, duration = 1500) {
	return new Promise((resolve, reject) => {
		uni.showToast({
			title,
			duration,
			mask: true,
			icon: "none",
		});
		setTimeout(() => {
			uni.hideToast();
			uni.navigateBack();
			resolve();
		}, duration);
	});
}